/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.cotelasa.scp.entidad;


import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;


/**
 *
 * @author Jorge
 */
@Entity
@Table(name = "venta_linea_credito_detalle",catalog = "bdcotelasa", schema = "cotelasa")
@NamedQueries({
    @NamedQuery(name = "VentaLineaCreditoDetalle.findAll", query = "SELECT v FROM VentaLineaCreditoDetalle v"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByIddetalle", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.iddetalle = :iddetalle"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByFechaOperacion", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.fechaOperacion = :fechaOperacion"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByDetalleConsumo", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.detalleConsumo = :detalleConsumo"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByMontoConsumo", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.montoConsumo = :montoConsumo"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByDetalleCredito", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.detalleCredito = :detalleCredito"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByMontoCredito", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.montoCredito = :montoCredito"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByLineaCredito", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.lineaCredito = :lineaCredito"),
    @NamedQuery(name = "VentaLineaCreditoDetalle.findByLineaSaldo", query = "SELECT v FROM VentaLineaCreditoDetalle v WHERE v.lineaSaldo = :lineaSaldo")})
public class VentaLineaCreditoDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @SequenceGenerator(name = "generadorLineaCreditoDetalle", sequenceName = "cotelasa.venta_linea_credito_detalle_id_seq")
    @GeneratedValue(generator = "generadorLineaCreditoDetalle") 
    @Basic(optional = false)
    @Column(name = "iddetalle")
    private Integer iddetalle;
    @Column(name = "fecha_operacion")
    @Temporal(TemporalType.DATE)
    private Date fechaOperacion;
    @Size(max = 200)
    @Column(name = "detalle_consumo")
    private String detalleConsumo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "monto_consumo")
    private Double montoConsumo;
    @Size(max = 200)
    @Column(name = "detalle_credito")
    private String detalleCredito;
    @Column(name = "monto_credito")
    private double montoCredito;
    @Column(name = "linea_credito")
    private double lineaCredito;
    @Column(name = "linea_saldo")
    private double lineaSaldo;
    @JoinColumn(name = "idlinea", referencedColumnName = "idlinea")
    @ManyToOne
    private VentaLineaCredito idlinea;

    public VentaLineaCreditoDetalle() {
    }

    public VentaLineaCreditoDetalle(Integer iddetalle) {
        this.iddetalle = iddetalle;
    }

    public Integer getIddetalle() {
        return iddetalle;
    }

    public void setIddetalle(Integer iddetalle) {
        this.iddetalle = iddetalle;
    }

    public Date getFechaOperacion() {
        return fechaOperacion;
    }

    public void setFechaOperacion(Date fechaOperacion) {
        this.fechaOperacion = fechaOperacion;
    }

    public String getDetalleConsumo() {
        return detalleConsumo;
    }

    public void setDetalleConsumo(String detalleConsumo) {
        this.detalleConsumo = detalleConsumo;
    }

    public Double getMontoConsumo() {
        return montoConsumo;
    }

    public void setMontoConsumo(Double montoConsumo) {
        this.montoConsumo = montoConsumo;
    }

    public String getDetalleCredito() {
        return detalleCredito;
    }

    public void setDetalleCredito(String detalleCredito) {
        this.detalleCredito = detalleCredito;
    }

    public double getMontoCredito() {
        return montoCredito;
    }

    public void setMontoCredito(double montoCredito) {
        this.montoCredito = montoCredito;
    }

    public double getLineaCredito() {
        return lineaCredito;
    }

    public void setLineaCredito(double lineaCredito) {
        this.lineaCredito = lineaCredito;
    }

    public double getLineaSaldo() {
        return lineaSaldo;
    }

    public void setLineaSaldo(double lineaSaldo) {
        this.lineaSaldo = lineaSaldo;
    }

    public VentaLineaCredito getIdlinea() {
        return idlinea;
    }

    public void setIdlinea(VentaLineaCredito idlinea) {
        this.idlinea = idlinea;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddetalle != null ? iddetalle.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VentaLineaCreditoDetalle)) {
            return false;
        }
        VentaLineaCreditoDetalle other = (VentaLineaCreditoDetalle) object;
        if ((this.iddetalle == null && other.iddetalle != null) || (this.iddetalle != null && !this.iddetalle.equals(other.iddetalle))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "prueba.VentaLineaCreditoDetalle[ iddetalle=" + iddetalle + " ]";
    }
    
}
